package com.wechat.process.message;

import com.wechat.constants.PropertiesConstants;
import com.wechat.pojo.WechatMessage;
import com.wechat.pojo.WechatTextMessage;
import com.wechat.utils.DateUtils;
import com.wechat.utils.PropertiesSingleton;

import java.io.PrintWriter;

/**
 * Created by why on 2018/2/27 0027.
 */
public interface WechatMessageProcessInterface {

    public void autoReplyWechatMessage(PrintWriter wechatWriter);

    default WechatMessage getWechatMessage(String openId) {
        String sender = PropertiesSingleton.newInstance().getProperties().getProperty(PropertiesConstants.WXDEVELOPERID);
        WechatMessage wechatMessage = new WechatMessage();
        wechatMessage.setFromUserName(sender);
        wechatMessage.setToUserName(openId);
        wechatMessage.setCreateTime(DateUtils.getNowDateString("yyyyMMddHHmmss"));
        return wechatMessage;
    }
}
